Skip to content

Conversation

euaaaio
Copy link

@euaaaio euaaaio commented Jul 27, 2020

This PR adds lost argument key to useStore function types.
Resolve #1807

@kiaking
Copy link
Member

kiaking commented Aug 4, 2020

Thanks for the PR! Yap, this is a defect. However, could you add support for InjectionKey as well as String?
Ref: https://composition-api.vuejs.org/api.html#dependency-injection

So It should be I think?

export function useStore<S = any>(key?: InjectionKey<Store<S>> | string): Store<S>;

@kiaking kiaking added the types Related to typings only label Aug 4, 2020
@euaaaio
Copy link
Author

euaaaio commented Aug 4, 2020

@kiaking, you're right. I refactored and added a few tests.

@euaaaio euaaaio requested a review from kiaking August 5, 2020 12:47
Copy link
Member

@kiaking kiaking left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks a lot 🙌

@kiaking kiaking merged commit 657afe3 into vuejs:4.0 Aug 11, 2020
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
types Related to typings only
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants